#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 1e5 + 10;
int n;
int arr[N];
int fun(int l, int r, int& s, int& e)
{
	if (l == r) {
		s = l;
		e = r;
		return arr[l];
	}
	int mid = (l + r) >> 1;
	int sum1 = fun(l, mid, s, e);
	int sum2 = fun(mid + 1, r, s, e);
	int ls = 0, lmax = 0;
	int rs = 0, rmax = 0;
	for (int i = mid; i >= l; i--) {
		ls += arr[i];
		if (ls > lmax) {
			lmax = ls;
			s = i;
		}
	}
	for (int i = mid + 1; i <= r; i++) {
		rs += arr[i];
		if (rs > rmax) {
			rmax = rs;
			e = i;
		}
	}
	int sum3 = lmax + rmax;
	return max(sum3, max(sum1, sum2));
}
int main()
{
	int t;
	cin >> t;
	int k = 1;
	while (t--) {
		cin >> n;
		memset(arr, 0, sizeof(arr));
		int start = 0, end = 0;
		for (int i = 0; i < n; i++) {
			scanf_s("%d", &arr[i]);
		}
		int ans = fun(0, n - 1, start, end);
		cout << "Case " << k++ << ":" << endl; 
		int i = 0;
		bool flag = 0;
		if (start != 0) {
			int idx = 0;
			for (i = start - 1; i >= 0; i--) {
				if (arr[i] == 0) {
					flag = 1;
					idx = i;
					continue;
				}
				else {
					break;
				}
			}
			if (flag)start = idx;
		}
		flag = 0;
		if (end != n - 1) {
			int idx = 0;
			for (i = end + 1; i < n; i++) {
				if (arr[i] == 0) {
					flag = 1;
					idx = i;
					continue;
				}
				else {
					break;
				}
			}
			if(flag)end = idx;
		}
		cout << ans << " " << start + 1 << " " << end + 1 << endl;
		if (t) {
			cout << endl;
		}
	}
	return 0;
}